/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Connexion;

import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import miage.sessions.ecom.remote.EcomCustomerRemote;

/**
 *
 * @author Pepito
 */
public class ConnexionCustomer { 
    public static EcomCustomerRemote connectionServerBean(){
        EcomCustomerRemote connexion = null;
        try {
            System.out.println("connectionServerBean");
            Properties propo = new Properties();
            propo.setProperty("org.omg.CORBA.ORBInitialHost","localhost"); //"172.30.18.220");
            propo.setProperty("org.omg.CORBA.ORBInitialPort","3700");// "1401");
            Context ctx = new InitialContext(propo);
            System.out.println(ctx.getEnvironment());
            //connexion = (EcomCustomerRemote) ctx.lookup("java:global/ecomProject-ejb/EcomCustomer");
            connexion = (EcomCustomerRemote) ctx.lookup("ecomCustomer");
            System.out.println("connexion bean server success");
        } catch (NamingException nex) {
            System.out.println(nex.toString());  
        }
        return connexion;
    }
}